home *** CD-ROM | disk | FTP | other *** search
/ Almathera Ten Pack 3: CDPD 3 / Almathera Ten on Ten - Disc 3: CDPD3.iso / scope / 001-025 / scopedisk6 / resource / resource.doc < prev    next >
Text File  |  1995-03-18  |  45KB  |  963 lines

  1.       Documentation for ReSource (C) 1988 Glen McDiarmid
  2.       
  3.       TO GET STARTED QUICKLY:
  4.       ****************************************************************
  5.       Don't forget to put arp.library in your LIBS: directory!
  6.       ****************************************************************
  7.       Run ReSource from a CLI, and when you are presented with a file
  8.       requester, select an executable file to disassemble (anything
  9.       within your "C" directory will do nicely).  Alternatively, you
  10.       may disassemble Kickstart by supplying a filename of "*".  Once
  11.       loaded, you may scroll forwards/backwards through the file with
  12.       the down/up arrow keys.  Using the shift key with the up/down
  13.       arrow keys will move you faster through the file.  You may also
  14.       use mouse-scrolling, by holding the left mouse button down, then
  15.       SLOWLY moving the mouse forwards or backwards, depending on which
  16.       way you want to move through the file.  While moving forwards
  17.       with the mouse, holding the left Amiga key down will start the
  18.       label creation process, in a controlled manner.  When labels are
  19.       created, ReSource decides which type of data is being labelled,
  20.       and it is generally correct in its judgement.  Once you have made
  21.       some labels, select the 'Fill-in data types' menu item, under the
  22.       "DISPLAY" menu.  Once you have created labels from all areas of
  23.       code, select 'Fill-in data types' again, and you may then scroll
  24.       through the file, checking for yourself that all is in order
  25.       (there will occasionally be cases where ReSource made an
  26.       incorrect judgement, and code made be shown as ASCII, or vice-
  27.       versa).  Use one of the "Set data types" sub-menu selections, to
  28.       set the correct data type.  Remember to use the "Fill-in data
  29.       types" command again, so that code and data are shown correctly.
  30.       
  31.       If you are working on a large file, you may wish to save your
  32.       work, so that you can continue it at a later time.  To do this,
  33.       select "save all" under the "PROJECT" menu.  When you use the
  34.       "save all" option, you are creating a "ReSource file", as it is
  35.       only useable by ReSource.  By default, the filename will end in
  36.       ".RS".  You may change this if you like.
  37.       
  38.       ****************************************************************
  39.       ABOUT RESOURCE:
  40.       ReSource is an interactive disassembler.  To give you an idea of
  41.       which files can and cannot be disassembled, the following is a
  42.       list of files from a Workbench 1.2 disk, that ReSource can
  43.       disassemble:
  44.       C directory: all
  45.       L directory: all
  46.       LIBS directory: all
  47.       DEMOS directory: Boxes, Dots, Spots
  48.       SYSTEM directory: CLI, DiskCopy, Format, GraphicDump, IconEd,
  49.       Say, SetMap.
  50.       DEVS directory: all keymaps, all printer drivers, everything
  51.       ending in ".device".
  52.       FONTS directory: everything within sub-directories
  53.       (topaz/11,emerald/17, etc.)
  54.       UTILITIES directory: Calculator, Notepad
  55.       ROOT directory: Preferences, Clock
  56.       
  57.  
  58.       
  59.  
  60.       
  61.       I personally wanted a good disassembler to fix bugs in many of
  62.       the public domain programs that I use.  I was also interested in
  63.       getting to know how C programs worked, at the assembly language
  64.       level.  ReSource is the result of 3 and a half months full-time
  65.       effort; during this time I have been using each version
  66.       extensively.  I am very impatient when it comes to waiting for
  67.       programs to complete operations, this has resulted in a
  68.       disassembler that is extremely fast, at the cost of memory usage.
  69.       Even though ReSource was written purely in assembly language, it
  70.       uses lots of memory, especially when disassembling large
  71.       programs.  Generally, if you have 1.5 Megs of memory, you will be
  72.       able to disassemble most programs.  To disassemble Kickstart, you
  73.       will require at least 2 Megs if you have a hard drive, or 3.5
  74.       Megs if you do not have a hard drive.  As a further condition,
  75.       there must be at least 1.1 Megs of contiguous memory, for the
  76.       attributes table. 
  77.       ****************************************************************
  78.       GENERAL USAGE:
  79.       ****************************************************************
  80.       Don't forget to put arp.library in your LIBS: directory!
  81.       ****************************************************************
  82.       Disassembling a program consists of examining a load file
  83.       (sometimes called "executable" or "object" files), and from the
  84.       information contained therein, create a text file (assembler
  85.       source code) which, when assembled, can be used identically to
  86.       the original load file.  It takes many, often hundreds, of hours
  87.       of painstaking work to become proficient at disassembling even a
  88.       small program manually.  Even experts can spend many hours
  89.       disassembling very small programs, while large Amiga programs may
  90.       take weeks.  From now on, this will not be the case with Amiga
  91.       programs.  Large programs (100K or larger) can be disassembled in
  92.       an evening, while small programs (such as CD, PROMPT, AVAIL,
  93.       ECHO, FILENOTE, etc., take around 3-5 seconds to produce re-
  94.       assemblable source code.
  95.       
  96.       As an example, let's disassemble LoadWB, which you'll find in the
  97.       C directory of just about any booting disk, including a standard
  98.       Workbench disk (make sure that it comes from a V1.2 Workbench,
  99.       not 1.1 or 1.3!  At the CLI prompt, type:
  100.       
  101.       RUN RS C:LOADWB
  102.       
  103.       You don't really have to use the "run" command, but I find it
  104.       convenient, so maybe you will too.  When ReSource starts running,
  105.       it will load the file "loadwb" from the C directory, and
  106.       disassemble the first page for you.  We can now start the label-
  107.       creation process.  This involves getting ReSource to examine
  108.       lines of code, and on each line, if there is any reference to
  109.       another part of the program, ReSource will decide which type of
  110.       data is being referenced.  For example, the first line of code in
  111.       our program is:
  112.       
  113.               MOVE.L  SP,START+$01E0
  114.             
  115.       
  116.       
  117.       
  118.       
  119.       Okay, go to the menus, under "LABELS" menu, you'll find "Create
  120.       single".  A sub-menu box will pop out, and from this, select
  121.       "Address symbol dest".  Now, the first line of code in our
  122.       program should be:
  123.       
  124.               MOVE.L  SP,lbL0001E0
  125.       
  126.       Now, scroll forward through the program (using shift-down arrow),
  127.       until you find a line starting with "lbL0001E0":
  128.       
  129.       lbL0001E0       dc.l    0
  130.       
  131.       The label "lbL0001E0" is something that ReSource has just now
  132.       created.  In this case, ReSource decided that the data being
  133.       referenced was a Longword, hence the "L" in "lbL0001E0".  If it
  134.       was code that was being referenced, the label would have been
  135.       "lbC0001E0" instead.  There are five type of data recognized by
  136.       ReSource:
  137.       
  138.       ASCII - CODE - BYTES - WORDS - LONGWORDS
  139.       
  140.       The processes involved in deciding which type of data is being
  141.       referenced is quite complex, and such things as the surrounding
  142.       code/data, the relative position of reloc32 areas, hunk types,
  143.       relative position from the start of a hunk, the actual
  144.       information being referenced, whether the data is word/longword
  145.       aligned, the actual instruction from which the reference was
  146.       derived, the proximity of other labels, and what data types they
  147.       refer to, all take part in the decision-making process.  If the
  148.       first line of code in out program had been:
  149.       
  150.               MOVE.W  SP,START+$01E0
  151.       
  152.       , then the label created would have been "lbW0001E0" instead, and
  153.       the data type at this label would have been set to words.  If you
  154.       like, you can manually set the data type of any byte in the
  155.       program, by selecting a sub-menu item from the "Set data type"
  156.       menu item, under "DISPLAY" in the menus.  This will not create a
  157.       label, but it will re-define the current byte within the file (on
  158.       the top line of the display) as being ASCII, CODE, or whichever
  159.       data type you selected.  Generally, this is not required, except
  160.       sometimes in large programs, but after letting ReSource do its
  161.       thing first.  If you like doing things with the mouse, you can
  162.       even set the data type this way.  Once you have mastered mouse
  163.       scrolling, try holding down the left-shift key while still
  164.       holding down the left mouse button.  This will display everything
  165.       as if it were set to the data type BYTES.  Holding down the left
  166.       alt key will display everything as if it were set to ASCII. 
  167.       Similarly, the left shift and left alt keys held down together to
  168.       show everything in WORDs; hold down the ctl key and everything
  169.       will be displayed as CODE.  Hold down all three, and everything
  170.       will be shown as LONGWORDS.  If you decide make this data type
  171.       permanent, press the menu button, and the current position within
  172.       the program will be set to the data type currently being
  173.       displayed.  By holding down the right alt key, you can remove
  174.       labels while scrolling.
  175.             
  176.       
  177.       
  178.       
  179.       
  180.       Now scroll back to the start of the program (select "Start of
  181.       file" submenuitem, under the "Absolute" menuitem under the
  182.       "CURSOR" menu).  Alternatively, just use the up arrow key, to
  183.       scroll back slowly.  Look in the screen title bar to find out how
  184.       far you are from the start of the file.  This offset is being
  185.       shown in hexdecimal.  Now, use the down arrow key to scroll
  186.       forward to the second line of code in our program:
  187.       
  188.               MOVE.L  D0,START+$01E8
  189.       
  190.       Again, select the "Address symbol dest" submenuitem, to create
  191.       the label "lbL0001E8".  Do this to as many lines of code as you
  192.       like, so that you become familiar with the label creating
  193.       process.  What you have just done can be done far quicker, by
  194.       using the "Create multiple" label functions.  Firstly, select the
  195.       "Open" menuitem, under "PROJECT" in the menus.  Again, we will
  196.       use "LoadWB" from within your C directory.  Once it is loaded,
  197.       look in the menu under "LABELS", go to the menuitem "Create
  198.       multiple", and select "All" from the sub-menuitem box.  Around
  199.       three quarters of a second later, you should be at position
  200.       "0001C8" relative from the start of the file.  The top line of
  201.       the display should read:
  202.       
  203.       lbL0001C8       dc.l    0
  204.       
  205.       If this is correct, you should now find some more code to make
  206.       labels from.  To do this, you could use the down arrow key to
  207.       scroll forward, the shift-arrow key to page forward, or let
  208.       ReSource do the searching for you, by selecting "Next unparsed
  209.       code" from the "CURSOR" menu.  If there is no more code that has
  210.       not been parsed, you will be returned to the start of the file. 
  211.       However in this case, there is more code to parse, so go to it! 
  212.       When eventually "Next unparsed code" returns you to the start of
  213.       the file, slowly scroll through the file, and examine as you go. 
  214.       You should find some ASCII, but it isn't being shown like it
  215.       really should.  This is the time to select "Fill-in data types"
  216.       from the "DISPLAY" menu.
  217.       
  218.       Okay, now the program is completely disassembled right?  Well,
  219.       nearly.  If you followed the above instructions to the letter,
  220.       there will be once more section of code that labels have NOT been
  221.       created from.  This will be at offset "000584".  This is because
  222.       this area of the program was only recognized as code, after it
  223.       had been skipped over.  In fact, the only reference to this part
  224.       of the program is made at offset "0005E6", and the code is:
  225.       
  226.               JSR     lbC000584
  227.       
  228.       Again, create multiple labels within this area, and search for
  229.       the next unparsed code.  If you select "Next unparsed code" while
  230.       at the start of the file, and ReSource cannot find any, then
  231.       again select "Fill-in data types", and this should complete the
  232.       disassembly of LoadWB.
  233.       
  234.             
  235.       
  236.       
  237.       
  238.       Actually, at this point, I generally will change some of the
  239.       labels, so that they are meaningful.  For instance, the first
  240.       line of code places the contents of the SP register at
  241.       "lbL0001E0", right?  Scroll forward to the line starting with
  242.       this label, and select "Address symbol" submenuitem, from the
  243.       "Create single" menuitem, under "LABELS" menu.  You will be
  244.       requested to input a new label name.  I would call this label
  245.       "SaveSP"; you call it anything you like.  Now, scroll backwards
  246.       to the offset "0000D2":
  247.       
  248.               MOVE.L  SaveSP,SP
  249.       
  250.       We didn't change this line, so what is going on?  You have just
  251.       witnessed one of the major benefits of an interactive
  252.       disassembler; any label changes you make are reflected throughout
  253.       the entire program, instantly.  Anywhere else in the program that
  254.       you can place a meaningful label, will help greatly in
  255.       recognizing how a program executes, without actually executing
  256.       it.  Also, if you wish to make changes to the source, meaningful
  257.       labels help greatly.  While still within ReSource, you may add
  258.       comments, both full-line, and end-of-line, to aid in the
  259.       understanding of the program. 
  260.       ****************************************************************
  261.       EXPLANATION OF FUNCTIONS:
  262.       The following section gives details of the uses of each function,
  263.       as they are shown in the menus.  Not all functions are enabled in
  264.       all versions, this is especially so in V0.x (demo version).
  265.       
  266.       PROJECT/Abort:
  267.               Use this to abort out of most functions.
  268.       
  269.       PROJECT/Open:
  270.               Requests you to select a file to open.  Use this function
  271.       to load executable files, as well as ReSource files.
  272.       
  273.       PROJECT/Restore:
  274.               Same as PROJECT/Open, but assumes that you wish to open
  275.       the same file as you last opened.
  276.       
  277.       PROJECT/Save .RS:
  278.               Saves the file that you are currently working on, in a
  279.       form useable only by ReSource.  Also saves the current location
  280.       with the file.  To continue work on the file later, use the
  281.       PROJECT/Open function.
  282.       
  283.       PROJECT/About:
  284.               Gives you some specific details about the version of
  285.       ReSource that you are currently using.
  286.       
  287.       PROJECT/Quit:
  288.               Asks you for confirmation, then quits without saving.
  289.       
  290.       OUTPUT/Save .asm:
  291.               Saves current file in assembler source code format.
  292.       
  293.             
  294.       
  295.       
  296.       
  297.       OUTPUT/O/P directory:
  298.               Requests you to supply the name of a directory that .asm
  299.       files will be sent to (you can still change this when you supply
  300.       the name of the output file, it just makes it easier if you are
  301.       disassembling many files).
  302.       
  303.       OUTPUT/Tabs:
  304.               Use to select between real tabs (ASCII value 9) and
  305.       spaces being used in the output source code.
  306.       
  307.       DISPLAY/Hiliting:
  308.               Selective use of inverse video can be useful to give
  309.       extra information about parts of a file.  For instance, you may
  310.       want to get a quick idea of which parts of a file came from a BSS
  311.       hunk, rather than CODE or DATA hunks.  To do this, select
  312.       DISPLAY/Hiliting/BSS hunks.
  313.       
  314.       DISPLAY/Hiliting/Reloc32:
  315.               I find it particularly useful to hilite the Reloc32
  316.       areas, especially when determining data types (reloc32 is
  317.       documented in the Amiga technical reference manual.  It
  318.       ultimately means that a number of longwords in the file point to
  319.       somewhere in memory, relative to the start of one of the hunks of
  320.       the file.  This almost always end up being somewhere within the
  321.       file.  This information helps ReSource greatly when defining data
  322.       types).
  323.       
  324.       DISPLAY/Hiliting/Chip load hunks:
  325.               Certain hunks of a load file may only be loaded into chip
  326.       memory.  Usually, graphics, especially sprites, will be included
  327.       in one of these special hunks, and this information is sometimes
  328.       useful, especially when you intend to re-assemble the file. 
  329.       "Chip load hunks" will hilite these hunks for you, also fast load
  330.       hunks may be hilited.
  331.       
  332.       DISPLAY/Hiliting/Symbol scan:
  333.               For all lines that you have created labels from, these
  334.       lines will be hilited.
  335.       
  336.       DISPLAY/Hiliting/Data type uncertain:
  337.               For most labels that ReSource creates automatically, it
  338.       is certain of the data type that it assigns.  Sometimes though,
  339.       it cannot be 100% sure, and this function will hilite all lines
  340.       that fall into this category.
  341.       
  342.       DISPLAY/Hiliting/Data type known:
  343.               Similar to above function, only the lines where the
  344.       ReSource was certain of the data type, will be hilited.
  345.       
  346.       DISPLAY/Hiliting/Internally produced refs:
  347.               All lines which have a label that was created by
  348.       ReSource, will be hilited.
  349.       
  350.       DISPLAY/Set data type:
  351.               When you are certain of which type of data that you are
  352.       looking at, select from one of the submenu items:
  353.       Code - Ascii - Bytes - Words - Longwords
  354.       
  355.              
  356.       
  357.       
  358.       
  359.       DISPLAY/Set numeric base:
  360.               By default, all numbers are shown in hexdecimal (base
  361.       16).  You can change this to ASCII, DECIMAL or BINARY on any line
  362.       by selecting from the appropriate sub-menu item.  To change back
  363.       to HEXDECIMAL, simply select the same function again.  It is
  364.       possible to change the default to decimal for numbers less than
  365.       16, or less than 10, using the decimal conversion function (see
  366.       below).
  367.       
  368.       DISPLAY/Decimal conversion:
  369.               By default, all numbers are show in hexdecimal.  You can
  370.       have numbers less than 16, or numbers less than 10, shown in
  371.       decimal throughout the file, by selecting one of the appropriate
  372.       sub-menu items.
  373.       
  374.       DISPLAY/Block-fill:
  375.               This function will probably not get much use.  It can be
  376.       used to set the data type of blocks of data.  For example, in a
  377.       particular file, there may a large section of code, maybe 100K or
  378.       so, and rather than rely on ReSource to make the correct
  379.       judgement of data type every time, you can set the data type of
  380.       every byte in the file to code, by doing the following:  Scroll
  381.       to the start of the block.  Set the data type here to CODE. 
  382.       Select the "CURSOR/Remember" function.  Now, scroll to the end of
  383.       the block (don't use any function that stacks the cursor
  384.       position, such as "CURSOR/Absolute/End of file", as this will
  385.       change the remembered offset.  When you get to the end of the
  386.       block, select the "DISPLAY/Block-fill" function.  The type of
  387.       data at the start of the block will be echoed throughout the
  388.       entire block.
  389.       
  390.       DISPLAY/Fill-in data types:
  391.               This function has several uses, and will be one of the
  392.       most-used functions.  To understand what this function does, you
  393.       will need to know how ReSource keeps track of data types (see
  394.       section "Inside ReSource").  Suffice it to say, when you set the
  395.       data type anywhere within a file, that data type is immediately
  396.       echoed forward, to a maximum of several hundred bytes, but will
  397.       not change any other places where the data type has already been
  398.       set, or where there is an address symbol (label) on a line. 
  399.       Where there is large areas of a file where the data type has not
  400.       been set, this function attempts to set the data type where
  401.       appropriate.  All of the above is done in the first pass.  On the
  402.       second pass, the length of each line is set, this is particularly
  403.       useful where there is large areas of ASCII.  This function should
  404.       always be used just before saving a file as source code (OUTPUT/
  405.       Save .asm).
  406.       
  407.       DISPLAY/Set counter:
  408.               The current offset in a file is always shown in the title
  409.       bar, in hexdecimal.  This is normal zero at the start of the
  410.       file.  You can change this, so that it is zero at somewhere other
  411.       than the start of the file, by using this function.  You may use
  412.       this function to measure the size of a hunk, for example.  To
  413.       "reset" the counter, use the function "DISPLAY/Reset counter".
  414.       
  415.       DISPLAY/Reset counter:
  416.               Resets the offset counter, in the title bar, so that it
  417.       is zero at the start of the file.  See "DISPLAY/Set counter".
  418.       
  419.             
  420.       
  421.       
  422.       
  423.       SYMBOLS:
  424.               When you create an assembly-language program, if you wish
  425.       to allocate some memory, you will probably have somewhere in you
  426.       file:
  427.       
  428.               JSR     _LVOAllocMem(A6)
  429.       
  430.       If you were to disassemble this program, this line of code would
  431.       be show as:
  432.       
  433.               JSR     -$0228(A6)
  434.       
  435.       , which is not particularly meaningful.  When disassembling a
  436.       program, if you can figure out which library base the A6 register
  437.       is pointing to (in this case, it would be the EXEC library), you
  438.       can get ReSource to make the appropriate substitution.  In this
  439.       example, you would select "SYMBOLS/E-G/Exec library".  Following
  440.       is another example:
  441.       
  442.               MOVE.L  #$00038007,D7
  443.               MOVE.L  4,A6
  444.               JSR     -$006C(A6)
  445.       
  446.       The second line loads Execbase into the A6 register, so you
  447.       should move the third line to the top of the display, and select
  448.       "SYMBOLS/E-G/Exec library".  Scroll back a couple of lines, and
  449.       you would see:
  450.       
  451.               MOVE.L  #$00038007,D7
  452.               MOVE.L  4,A6
  453.               JSR     _LVOAlert(A6)
  454.       
  455.       If you looked at the documentation for the Exec "Alert" call, you
  456.       would find that one of the input parameters is required to be in
  457.       the D7 register.  If you then looked in the include file "exec/
  458.       alerts.i", you would find that the number "$00038007" consists of
  459.       three values, OR'd together:
  460.       
  461.       AT_Recovery  -  AG_OpenLib  -  AO_DOSLib
  462.       
  463.       There is no need to go to all this trouble, simple line up the
  464.       first line with the top of the display, and select "SYMBOLS/A-B/
  465.       Alert codes", and ReSource will make the appropriate
  466.       substituition for you:
  467.       
  468.               MOVE.L  #AT_Recovery!AG_OpenLib!AO_DOSLib,D7
  469.               MOVE.L  4,A6
  470.               JSR     _LVOAlert(A6)
  471.       
  472.       Now isn't that much better than the original?  There are over 200
  473.       different classes of symbols that ReSource can substitute (only
  474.       two are enabled in the demo version).
  475.       
  476.               Consider the following lines of code:
  477.       
  478.               MOVE.L  4,A4
  479.               MOVE.L  #$100000,$003A(A4)
  480.       
  481.            
  482.       
  483.       
  484.       
  485.       Let's assume that you wish to substitute a symbol for the "$003A"
  486.       in the second line of code.  By default, ReSource will attempt to
  487.       substitute a symbol for the first number that it finds in a line
  488.       of code.  To change this, select "SYMBOLS/Set source/dest/
  489.       Destination", and then the appropriate symbol base (Exec library,
  490.       in this example).
  491.       
  492.       CURSOR/Remember:
  493.               Where it is possible to lose your place within a file by
  494.       using certain functions (such as "CURSOR/Absolute/Start of
  495.       file"), ReSource will store the current cursor location, just
  496.       prior to the function being executed.  To return to the previous
  497.       cursor location, select "CURSOR/Absolute/Previous location". 
  498.       When you plan to return to a specific place within the file,
  499.       using this function will make it easier to do so.  It simply
  500.       stores the cursor location on a stack, for later access.
  501.       
  502.       CURSOR/Clear Loc stack:
  503.               The cursor location stack can contain up to 256
  504.       locations.  If more locations are "pushed" onto this stack, the
  505.       location at the bottom (the oldest) are forgotten.  This function
  506.       will empty the cursor location stack.
  507.       
  508.       CURSOR/Relative/Next byte:
  509.               The cursor position is incremented.
  510.       
  511.       CURSOR/Relative/Previous byte:
  512.               The cursor position is decremented.
  513.       
  514.       CURSOR/Relative/Next line:
  515.               Scroll forward by one line.
  516.       
  517.       CURSOR/Relative/Previous line:
  518.               Scroll backwards by one line.  The length of a line will
  519.       depend on what the data type is.  Until you first use "DISPLAY/
  520.       Fill-in data types", backwards scrolling may not be quite what
  521.       you expect.
  522.       
  523.       CURSOR/Relative/Next page:
  524.               Scroll forward by one page.  This will be approximately
  525.           20 lines.
  526.       
  527.       CURSOR/Relative/Previous page:
  528.               Scroll backwards by one page.  This will be approximately
  529.           20 lines.
  530.       
  531.       CURSOR/Relative/Skip forward:
  532.               Scroll forward by approx 4096 bytes ($1000).
  533.       
  534.       CURSOR/Relative/Skip Backward:
  535.               Scroll backward by approx 4096 bytes ($1000).
  536.       
  537.       CURSOR/Relative/Next unparsed code:
  538.               Scroll forward to the next line of code, that has been
  539.       labelled, and that has not been parsed for labels yet.
  540.       
  541.             
  542.       
  543.       
  544.       
  545.       CURSOR/Relative/Next data type change:
  546.               Scroll forward to the next byte whose data type is
  547.       different to the data type of the current byte.
  548.       
  549.       CURSOR/Relative/Previous data type change:
  550.               Scroll backward to the first byte found whose data type
  551.       is different to the data type of the current byte.
  552.       
  553.       CURSOR/Relative/Next uncertain data type:
  554.               Scroll forward to the next position within the file that
  555.       ReSource has labelled, but at the time was not quite sure of
  556.       which data type to set.
  557.       
  558.       CURSOR/Relative/Next backward reference:
  559.               Using the "CURSOR/Absolute/Backward reference" function,
  560.       it is possible to find the first reference to the current
  561.       position within the file.  Use this function to find further
  562.       references to the same position.  The search function could be
  563.       used instead, but may also find references within comments,
  564.       mnemonics, or even within other labels.
  565.       
  566.       CURSOR/Absolute/End of file:
  567.               Move cursor to the last line of the file.
  568.       
  569.       CURSOR/Absolute/Start of file:
  570.               Move cursor to the first line of the file.
  571.       
  572.       CURSOR/Absolute/Forward reference:
  573.               I'll use an example to explain this one:
  574.       
  575.                           JSR    lbC0132DE
  576.       
  577.               If you wanted to "check out" the subroutine at label
  578.       "lbC0132DE", but later return to the current cursor position,
  579.       simply scroll until this line is on the top line of the display,
  580.       and select "CURSOR/Absolute/Forward reference".  The current
  581.       cursor location is stored (on a stack), so that you can return to
  582.       this cursor position, using the "CURSOR/Absolute/Previous
  583.       location" function.
  584.       
  585.       CURSOR/Absolute/Forward reference:
  586.               This is similar to the "CURSOR/Absolute/Forward
  587.       reference" function, except that on a line such as:
  588.       
  589.                           MOVE.L  lbL00DEAF,lbL00BEEF
  590.       
  591.               the second label is used (lbL00BEEF), rather than the first
  592.       (lbL00DEAF).
  593.       
  594.       CURSOR/Absolute/Backward reference:
  595.               Use to find the first reference made to the current
  596.       cursor position.  See "CURSOR/Absolute/Next backward reference".
  597.       
  598.       CURSOR/Absolute/Previous location:
  599.               With many functions that change the cursor location
  600.       substantially, the current cursor position is stored on a stack. 
  601.       To "pop" the last saved location, use this function.
  602.       
  603.             
  604.       
  605.       
  606.       
  607.       CURSOR/Scrolling speed:
  608.               You can select from five scrolling speeds.  This relates
  609.       to the speed/smoothness of scrolling when using the "CURSOR/
  610.       Relative/Next line" and "CURSOR/Relative/Previous line" functions.
  611.       
  612.       CURSOR/Search/Set search pattern:
  613.               You will be requested to input a string.  Unless you
  614.       select "CANCEL", the string you input will be searched for
  615.       immediately, starting at the current cursor position.  Normal ARP
  616.       wildcards are accepted:
  617.       
  618.                   (a|b|c)   Will match one of a, b or c.
  619.                             These can be patterns.
  620.       
  621.                   ? Matches any single character
  622.                   #<pat>   Pattern repeated 0 or more times,
  623.                            in particular, #? matches anything.
  624.       
  625.                   [char]   A set of characters, for example,
  626.                            [abc] or [a..c] specify the same set.
  627.       
  628.                   [^char]   Match everything but this set of characters.
  629.       
  630.                   *         0 or more occurances of any character.
  631.       
  632.       CURSOR/Search/Find next occurence:
  633.               Using the current search string, search forward from the
  634.       current cursor position.  See "CURSOR/Search/Set search pattern".
  635.       
  636.       LABELS/Create single/End-of-line comment:
  637.               You will requested for a string, which will be shown at
  638.       the end of the current line, starting with " ; ".
  639.       
  640.       LABELS/Create single/Full-line comment:
  641.               You will requested for a string, which will be shown on a
  642.       seperate line, previous to the current line, starting with "; ". 
  643.       Generally, this will be used to add a comment too long to put at
  644.       the end of the current line.
  645.       
  646.       LABELS/Create single/Address symbol:
  647.               You will be requested for a string, which will become the
  648.       label for the current line.  Any references to the current line
  649.       will use the new label name, throughout the entire file,
  650.       immediately.
  651.       
  652.       LABELS/Create single/Address symbol dest:
  653.               The current line of code will be searched for references
  654.       to positions within the current file.  If any are found, ReSource
  655.       will make a decision on which type of data is at the position
  656.       referenced, it will then set the data type, and create a label at
  657.       that offset.  This new label will be immediately used for all
  658.       references to that location, which of course includes the
  659.       reference within the current line.  If the current line is not
  660.       being shown as code, or if there is no references, or there is a
  661.             
  662.       
  663.       
  664.       
  665.       reference, but it is outside of the range of the current file,
  666.       then this function will do nothing.  Normally, this function will
  667.       only be used within macros, as it is easier and quicker to hold
  668.       down the left Amiga key, while holding down the left mouse
  669.       button, possibly while scrolling also.
  670.       
  671.       LABELS/Create single/Value symbol:
  672.               Following is several examples of address symbols
  673.       (labels), and value symbols.
  674.       
  675.       lbC000124        MOVE.B   bm_Depth(A0),D0
  676.       
  677.       In the above line, "lbC000124" is an address symbol, and
  678.       "bm_Depth" is a value symbol.
  679.       
  680.                        MOVE.B   bm_Depth(A0),DepthByte
  681.       
  682.       In this line, "DepthByte" is and a reference to an address symbol
  683.       (label), NOT a value symbol.
  684.       
  685.                        MOVE.L   #MEMF_CLEAR,D1
  686.       
  687.       In this line, "MEMF_CLEAR" is a value symbol.  If a value symbol
  688.       had not been created for this line, the line would be:
  689.       
  690.                        MOVE.L   #$10000,D1
  691.       
  692.       Address symbols (labels) always equate to a position within the
  693.       file, while value symbols may equate to any value at all. 
  694.       Unfortunately, there is several cases where a value symbol may
  695.       equate to a position within the file:
  696.       
  697.                        MOVEA.L   #lbC000134,A0
  698.                        JSR       (A0)
  699.       
  700.       In this case, you may assign a value symbol, in which case the
  701.       value symbol will be shown, not the label name of the position
  702.       within the file that the instruction refers to.  If however, you
  703.       later remove the value symbol, the then label name of the line
  704.       being referenced (at present, this is "lbC000134"), will be
  705.       shown.  When you create an address symbol or value symbol, the
  706.       name is NOT checked for validity, it is up to you to decide
  707.       whether or not the assembler that you will be using will accept
  708.       the resulting code.  For example:
  709.       
  710.                        MOVE.L    #FFFFFFFA,D0
  711.       
  712.       may be changed to:
  713.       
  714.                        MOVE.L    #-6,D0
  715.       
  716.       by creating a value symbol "-6".  Virtually any value can be
  717.       given a value symbol, including bit numbers:
  718.        
  719.                        BTST      #AFB_68020,$0124(A6)
  720.       
  721.             
  722.       
  723.       
  724.       
  725.       LABELS/Create single/Value symbol - dest:
  726.               Similar to "LABELS/Create single/Value symbol" function,
  727.       except that the second reference within the current line will
  728.       used, rather than the first:
  729.       
  730.                        BTST      #4,SysFlags(A6)
  731.       
  732.       LABELS/Edit single:
  733.               All of these functions are identical to their
  734.       counterparts in "LABELS/Create single", except that if their is
  735.       an existing label/symbol/comment, you will be requested to edit
  736.       it, rather than create a new one.  Given the editing capabilities
  737.       of a string gadget, the create functions are a luxury really,
  738.       although I find that when I change a label/symbol/comment, I
  739.       generally make it nothing like the original, hence I nearly
  740.       always use the create functions, to save me the trouble of
  741.       pressing "rAmiga-X".
  742.       
  743.       LABELS/Remove single/Address symbol:
  744.               Remove any address symbol (label) for the current line.
  745.       
  746.       LABELS/Remove single/Value symbol:
  747.               Remove ALL value symbols in the current line.
  748.       
  749.       LABELS/Remove single/End-of-line comment:
  750.               Remove any end-of-line comment for the current line.
  751.       
  752.       LABELS/Remove single/All:
  753.               Remove all symbols and comments for the current line.
  754.       
  755.       LABELS/Create multiple/Reloc32 all:
  756.               For each reloc32 pointer within the current file,
  757.       determine the data type being referenced, set the data type, and
  758.       create a label at that address.  This function should be used
  759.       with caution, as when it makes a decision on the data type, it
  760.       does not have the same information available as when creating
  761.       labels normally.  This function should be most useful after
  762.       creating labels from all code in a program, where there is one or
  763.       more large tables of pointers.
  764.       
  765.       LABELS/Create multiple/All:
  766.               Starting at the current address, the "LABELS/Create
  767.       single/Address symbol dest" function is executed, and if ReSource
  768.       thinks that there was valid code in the current line, the
  769.       "CURSOR/Relative/Next line" function is executed, and the entire
  770.       function loops, otherwise the "PROJECT/-=Abort=-" function is
  771.       executed.  This function can make the disassembly process very
  772.       fast, the disadvantage being that there is a very slight chance
  773.       that what ReSource thinks is valid code, is really ascii, and
  774.       invalid labels will be created.
  775.       
  776.       SPECIAL FUNCTIONS/Repeat last command:
  777.               Execute the last function that was executed.  This does
  778.       not include most cursor movements.  By rebinding this function to
  779.       an easily-accessed key, such as the space bar, (and saving the
  780.       keytable) there should be much less need to rebind keys often.
  781.       
  782.             
  783.       
  784.       
  785.       
  786.       SPECIAL FUNCTIONS/Convert xx(A4) EA's
  787.               These functions were specifically designed to be used
  788.       when disassembling 'C' programs, in which the A4 register is used
  789.       as a base register for accessing data, throughout all or most of
  790.       the program.  Let's use an example program here:
  791.       
  792.                           SECTION  test000000,CODE
  793.                           LEA      START+$11E,A4
  794.                           LEA      0(A4),A1
  795.                           MOVE.L   $000C(A4),D0
  796.       .... rest of code
  797.                           SECTION  test00011E,DATA
  798.                           dc.b     'dos.library',0
  799.                           dc.l     $00010001
  800.                           END
  801.       
  802.       In the above program, the A4 register will point to the start of
  803.       the data segment.  There are three ways to tell ReSource where
  804.       the A4 register will point to; in the above example, the "This
  805.       operand" function could be used with the cursor at start of file,
  806.       or the "This address" function could be used with the cursor at
  807.       offset $00011E, or the "Specify" function could be used, suppying
  808.       a parameter of "11E".  Basically, with this function, you are
  809.       telling ReSource where, relative to the start of the program, the
  810.       A4 register can be assumed to be pointing.  After you do this,
  811.       any effective address that involves a word offset to the A4
  812.       register, will be shown as an absolute address.  Thus, the
  813.       example program above will appear as:
  814.       
  815.                           SECTION  test000000,CODE
  816.                           LEA      START+$011E,A4
  817.                           LEA      START+$011E,A1
  818.                           MOVE.L   START+$012A,D0
  819.       .... rest of code
  820.                           SECTION  test00011E,DATA
  821.                           dc.b     'dos.library',0
  822.                           dc.l     $00010001
  823.                           END
  824.       
  825.       The advantage here is that labels can automatically be created
  826.       where they could not before.  If this conversion process is not
  827.       used, it is likely that the program will not successfully re-
  828.       assemble, as different assemblers assemble the same source code
  829.       into different opcodes.  For example, the assembler that I
  830.       normally use does virtually no optimizing, and so the resulting
  831.       program is often larger than the original, even if I did not
  832.       modify the source code.  For example:
  833.       
  834.                           MOVE.L   4,A6
  835.       
  836.       If absolute long addressing is used, the instruction above will
  837.       be 6 bytes long, whereas if absolute short addressing is used, it
  838.       will be only 4 bytes long.  Where you wish to do EA conversions
  839.       in only a portion of a program, you can set the lower and upper
  840.       limits.
  841.       
  842.             
  843.       
  844.       
  845.       
  846.       Changing to absolute EA's will increase the size of the resulting
  847.       program, unless you convert back to relative addressing, within
  848.       the source code.  I believe that one of the features of BLINK
  849.       (from the Software Distillery) can help to make this conversion.
  850.       
  851.       SPECIAL FUNCTIONS/Convert specific EA's:
  852.               Please read and understand the "SPECIAL FUNCTIONS/Convert
  853.       xx(A4) EA's" functions first!  Where you want to do specific EA
  854.       conversions, use "Set base #1" (or #2, or #3), when the cursor is
  855.       the same as where the base register (whatever that is, it does
  856.       not have to be A4 this time) can be assumed to point to. 
  857.       Assuming that you set base #1, and it is the A5 register that is
  858.       being used as a base register, you will then use the "Convert W/
  859.       Base #1" function to convert lines like:
  860.       
  861.                           MOVE.L   $0032(A5),A6
  862.       
  863.       .. into:
  864.       
  865.                           MOVE.L   lbL0014AC(A5),A6
  866.       
  867.       Note here that there has not actually been an EA conversion, but
  868.       a label has been created, the data type at label "lbL0014AC" has
  869.       been determined and set, and a value symbol ("lbL0014AC") has
  870.       been created for this line.  It is up to you then to make the
  871.       necessary changes to the resulting source code, if re-assembling
  872.       is required.  Whereas the "Convert xx(A4) EA's" function converts
  873.       immediately and automatically, you must use the "Convert W/Base
  874.       #1" function on each line that you want converted.  If you wish
  875.       to convert a destination address, first use the "SYMBOLS/Set
  876.       source/dest/Destination" function first.
  877.       
  878.       MACROS:
  879.               There are currently twelve user-definable macros
  880.       available in ReSource.  To start macro #1, select "MACROS/Start/
  881.       #1", select the functions to be included in the macro (you can
  882.       use the menus, or press keys, it's all the same thing to the
  883.       macro).  When you are done, select "MACROS/Start/#1" again, to
  884.       end the macro.  To run the macro, select "MACROS/Execute/#1". 
  885.       The display is always refreshed during the defining of a macro,
  886.       however it is not during the execution.  At the end of a macro,
  887.       the display is always refreshed.  You may nest macros, but you
  888.       should not use recursion.  If ReSource finds that the nesting
  889.       level has exceeded 40, the macro will be abandoned.
  890.       
  891.               Macro files can be saved and re-loaded.  When ReSource
  892.       first starts up, it looks for "S:RS.macros".  If it finds it, it
  893.       will load it, and execute macro #12 immediately (that is why
  894.       macro #12 is hilited in the menus).  This is used to configure
  895.       ReSource.  Just start macro #12, set what option you want, end
  896.       macro #12, save the macro file as "S:RS.macros", and ReSource
  897.       will be configured every time that you run it.
  898.       
  899.             
  900.       
  901.       
  902.       
  903.       KEY BINDINGS:
  904.               Every function in ReSource can be found in the menus. 
  905.       You do not need to use any keys at all, but you probably will
  906.       want to.  You can bind any function to any key.  All Amiga keys
  907.       are supported, you may use shift, alt, ctl, lAmiga, rAmiga,
  908.       shift-alt, shift-ctl, alt-ctl, or shift-alt-ctl in combination
  909.       with any key, as a distinct key to bind a function to.  Thus, you
  910.       have complete control over which keys do what.  After re-binding
  911.       some keys, you will probably want to save the keytable.  If you
  912.       save the keytable as "S:RS.keytable", it will be loaded every
  913.       time you run ReSource.  You may want to create several keytables,
  914.       suitable for doing differing program types (C, assembler, etc.).
  915.       
  916.       OPTIONS/Show offsets:
  917.               If this option is set to ON, all lines will start with
  918.       either a label, or the offset from the start of the file.
  919.       
  920.       OPTIONS/Display Beep:
  921.               If this option is set to ON, the "BeepDisplay" function
  922.       is used to give feedback to the user, that either a function has
  923.       failed, or that a lengthy function has completed, and that the
  924.       user should now wake up.
  925.       
  926.       OPTIONS/User Feedback:
  927.               If this option is set to ON, messages will appear in the
  928.       title bar, to let the user know what ReSource is doing,
  929.       especially while doing functions that take a lot of time,
  930.       extraordinary functions that only ReSource has direct control
  931.       over (such as dynamically allocating more memory for strings,
  932.       etc.), and also information about what hunks, etc., that it finds
  933.       in a load file.
  934.       
  935.       OPTIONS/Feedback Delays:
  936.               If this option is set to ON, whenever a feedback message
  937.       is displayed, ReSource will wait for you to read the message,
  938.       before continuing.  You will probably not want to keep this on
  939.       all the time, as it can slow down the disassembly process
  940.       somewhat, but while you are learning to use ReSource, it will
  941.       probably be very useful.
  942.       
  943.       OPTIONS/Labels:
  944.               If this option is set to ON, labels will be displayed.  This is
  945.       the default.
  946.       
  947.       
  948.       OPTIONS/Value symbols:
  949.              If this option is set to ON, value symbols will be displayed. 
  950.       This is the default.
  951.       
  952.       OPTIONS/End-of-line comments:
  953.              If this option is set to ON, end-of-line comments will be
  954.       displayed.  This is the default.
  955.       
  956.       OPTIONS/Full-line comments:
  957.              If this option is set to ON, full-line comments will be
  958.       displayed.  This is the default.
  959.       ****************************************************************
  960.       Don't forget to put arp.library in your LIBS: directory!
  961.       ****************************************************************
  962.  
  963.